using System;
using Blazing.BusinessObjects.Cms;
using Blazing.WebFacade;
using System.Collections.Generic;
using Iesi.Collections.Generic;

namespace Blazing.Web
{
    public sealed class CmsFacade
    {
        public static Contentpage GetPageById(int pageId)
        {
            PageController pageCon = new PageController();
            return pageCon.GetPage(pageId);    
        }

        public static Contentpage GetPageByPermalink(int siteId, string url)
        {
            PageController pageCon = new PageController();
            return pageCon.GetPage(siteId, url);            
        }

        public static Menu GetMenuBySiteType(int siteId, int menuTypeId)
        {
            MenuController menuCon = new MenuController();
            return menuCon.GetMenuByType(siteId, menuTypeId);            
        }

        #region Statistics

        public static StatisticUseragent GetUserAgentByName(string useragentName)
        {
            StatisticController statCon = new StatisticController();
            return statCon.GetStatisticUseragents(useragentName);            
        }

        public static StatisticVisitor GetVisitorByGuid(Guid guid)
        {
            StatisticController statCon = new StatisticController();
            return statCon.GetStatisticVisitors(guid);   
        }

        public static StatisticOperatingSystem GetOperatingSystemByName(string osname)
        {
            StatisticController statCon = new StatisticController();
            return statCon.GetStatisticOperatingSystems(osname);   
        }
        
        public static StatisticSession GetSessionByKey(string sessionkey)
        {
            StatisticController statCon = new StatisticController();
            return statCon.GetStatisticSessions(sessionkey);   
        }

        public static StatisticReferrer GetReferrerByUrl(string referrerUrl)
        {
            StatisticController statCon = new StatisticController();
            return statCon.GetStatisticReferrers(referrerUrl);   
        }

        #endregion
    }
}
